package cn.jbooter.swagger.autoconfigure.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * application.yml配置文件
 * @author hejian
 *
 */
@ConfigurationProperties(prefix = "spring.swagger2")
public class ISwagger2Properties {

	/** 是否开启 **/
	private boolean enabled=false;
	
	/**
	 * swagger扫描的包路径;多个包使用,号隔开
	 */
	private String basePackages;
	/**
	 * 接口文档
	 */
	private String title="Swagger2 接口文档";
	
	/**
	 * 接口描述
	 */
	private String description="Swagger2 接口文档";
	/**
	 * 服务条款网址
	 */
	private String termsOfServiceUrl;
	/**
	 * api version
	 */
	private String version="1.0.0";
	/**
	 * 文档联系方式信息
	 */
	private Contact contact= new Contact();
	/**
	 * license信息
	 */
	private String license;
	/**
	 * licenseUrl
	 */
	private String licenseUrl;
	
	public boolean isEnabled() {
		return enabled;
	}
	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getTermsOfServiceUrl() {
		return termsOfServiceUrl;
	}
	public void setTermsOfServiceUrl(String termsOfServiceUrl) {
		this.termsOfServiceUrl = termsOfServiceUrl;
	}
	public String getVersion() {
		return version;
	}
	public void setVersion(String version) {
		this.version = version;
	}
	public Contact getContact() {
		return contact;
	}
	public void setContact(Contact contact) {
		this.contact = contact;
	}
	public String getLicense() {
		return license;
	}
	public void setLicense(String license) {
		this.license = license;
	}
	public String getLicenseUrl() {
		return licenseUrl;
	}
	public void setLicenseUrl(String licenseUrl) {
		this.licenseUrl = licenseUrl;
	}
	public String getBasePackages() {
		return basePackages;
	}
	public void setBasePackages(String basePackages) {
		this.basePackages = basePackages;
	}

	public static class Contact {
		private String name;
	    private String url;
	    private String email;
	    
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public String getUrl() {
			return url;
		}
		public void setUrl(String url) {
			this.url = url;
		}
		public String getEmail() {
			return email;
		}
		public void setEmail(String email) {
			this.email = email;
		}
		
		public springfox.documentation.service.Contact getContact() {
			springfox.documentation.service.Contact contact = new springfox.documentation.service.Contact(this.name,this.url,this.email);
			return contact;
		}
	}
	
}
